package com.anxinr.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 拦截器拦截处理方式
 *
 * @author anxinr
 */
@Slf4j
@Component
public class StudyInterceptor implements HandlerInterceptor {
//    @Autowired
//    private RedisUtil redisUtil ;
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler){
//        /**查看是否登录*/
//        String token = request.getHeader("token");
//        if (StringUtils.isBlank(token)){
//            throw new LogicException(ExceptionEnum.STUDY_USER_NAME_ERROR) ;
//        }
//        /**处理跨域请求*/
//        if (!(handler instanceof HandlerMethod)){
//            return true;
//        }
        return true;
    }
}
